<?php

namespace App\Http\Controllers\Admin\System\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\Company;

class systemApi extends Controller
{
    public function list()
    {
    	$list = Company::select()
    	->get()
    	->first();
    	return $list;
    }

    public function chg($arr)
    {
    	$chg = Company::find(1);

        // dd($arr);

        $chg->name=$arr['name'];
        $chg->meta=$arr['meta'];
        $chg->content=$arr['content'];
        $chg->foot=$arr['foot'];
        $chg->record=$arr['record'];
        $chg->sttr=$arr['attr'];

        if (isset($arr['logo_path'])) {

            $chg->logo_path=$arr['logo_path']; 
            
        }

    	$chg->save();

    }
}
